Skip to content

chore: use import.meta.dirname in tests - #1303

Merged
AdrianGonz97 merged 9 commits into
sveltejs:version-1from
sacrosanctic:import-meta-dirname
Aug 30, 2026
Merged

chore: use import.meta.dirname in tests#1303
AdrianGonz97 merged 9 commits into
sveltejs:version-1from
sacrosanctic:import-meta-dirname

Conversation

@sacrosanctic

@sacrosanctic sacrosanctic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #

Description

  • use import.meta.dirname (introduced in node@20.11.0) over fileURLToPath
  • use uniform names and paths
  • use empathic/find to find ROOT

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 28, 2026

Copy link
Copy Markdown

Install the latest version of sv from f55aeff:

pnx https://pkg.svelte.dev/sv/c/f55aeffa312e37f5b7467553285110174be6b440 create

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1303

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f55aeff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR


// path to the `node_modules` directory of `sv`
const NODE_MODULES = fileURLToPath(new URL('../../node_modules', import.meta.url));
const NODE_MODULES = path.resolve(import.meta.dirname, '..', '..', 'node_modules');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just want to note that this change is in a module that's outside of our tests and is in core, which should be fine given that our minimum supported version is node v22

@AdrianGonz97 AdrianGonz97 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, thank you!

@AdrianGonz97
AdrianGonz97 merged commit 08b3fc3 into sveltejs:version-1 Aug 30, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants